import React from 'react';
import { Icon } from 'antd-mobile';
import {Link} from 'react-router-dom'
import Btn from './status'
export default function Item(props) {
  let { i = {} ,index,checked,del} = props;
  console.log(1213,index)
  return (
    <div className='listItem'>
      <div className="ttflx">
        <div className={"imgBox"}>
          {i.name.slice(0, 1)}
        </div>
        <div className="listContent">
          <p className="title"><Btn type={i.tag} /><i>{i.name} </i>  {i.phone}</p>
          <p className="details"> {i.address}</p>
        </div>
        <Link to={"/addressEdit/" + i.id} className="setOp">
          <span className="iconfont">&#xe66b;</span>
        </Link>
      </div>
      <div className="spSp">
      <span className="ft" onClick={()=>checked(index)}>
        {!i.selected ? 
       <i className="isCheck" > </i>  
       :  <i className="isCheck active">
          <Icon size="xxs" type="check" color="#ffffff" />
        </i> }
        设为默认地址</span>
        <span  onClick={()=>del(index)}>删除</span>
      </div>
    </div>
  )
}
